package eunms;

/**
 * @program: javase
 * @description:
 * @author: lld
 * @create: 2020-10-18 20:30
 **/
public enum Color {
    RED("红色",1),GREEN("绿色",2),BLUE("蓝色",3);
    // 成员变量 eunms.Color RED=new eunms.Color(name,index);
    private String name;
    private int index;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    // 构造方法
    private Color(String name, int index) {
        this.name = name;
        this.index = index;
    }
    public static void main(String[] args) {
        Color blue = Color.BLUE;
        System.out.println(blue.name);
    }
}
